

export function toSuccess(data: any, total?: number) {
    return { success: true, message: 'ok', data, total }
}

export function toFail(message: string, data?: any) {
    return { success: false, message: message, data }
}